﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SH.Common.CommonReturn;
using SH.Multitenant.Application.IServices.ITenant;
using SH.Multitenant.Domain.Multitenant;



namespace SH.Multitenant.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TenantController : ControllerBase
    {
        private readonly ITenantServices _tenantsServices;

        public TenantController(ITenantServices tenantsServices)
        {
            _tenantsServices = tenantsServices;
        }
        
        /// <summary>
        /// 租户添加
        /// </summary>
        /// <param name="tenantInfo"></param>
        /// <returns></returns>
        [HttpPost]
        [AllowAnonymous]
        public async Task<IActionResult> TenantAddAsync(TenantDTO tenantInfo)
        {
            var result = await _tenantsServices.TenantAddAsync(tenantInfo);
            return Ok(result);
        }
    }

}
